package com.lifeng.patterns.strategy1;

import com.lifeng.patterns.strategy.PayOrderVo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by lifeng on 2019/8/15.
 */
@RestController
public class StrategyController1 {
    @Resource
    private PayFactory payFactory;

    @RequestMapping("/pay")
    public String orderPay(String payStyle){
        payFactory.getPayService(payStyle).pay(new PayOrderVo());
        return "ok";
    }

}
